#!/usr/bin/env python

from datetime import datetime
from apscheduler.schedulers.blocking import BlockingScheduler
import abbrs

def job_func():
    import os
    os.system('git_pull.sh')
    os.system('python train.py')

if __name__ == '__main__':
    scheduler = BlockingScheduler(timezone="Asia/Shanghai")
        # An error may occur if timezone not explictly set:
        #   Timezone offset does not match system offset: 0 != -32400. Please, check your config files
    scheduler.add_job(job_func, 'cron', hour=1)
    print('Scheduler on.')
    scheduler.start()